/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication1;

/**
 *
 * @author user
 */
public class bai14 {
    public static void main(String[] args) {
        System.out.println(maxN(910763, 0));
    }

    private static int maxN(int n,int max){
        if(n<10){
            if(max<n) return n;
            else return max;
        }
        if(max<(n%10)){
            return maxN(n/10,n%10);
        }else 
            return maxN(n/10,max);
    }
}
